package com.example.xgakj.securityguard.models;

import com.example.xgakj.mylibrary.mvp.utils.CommonUtil;
import com.example.xgakj.securityguard.base.BaseApplication;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import com.socks.library.KLog;

/**
 * @author Administrator
 * @date 2017-10-16
 */

public class LoginModel {
    public void login(String name,String password){

        OkGo.<String>post(BaseApplication.baseUrl)
                .isSpliceUrl(true)
                .params("cmd","login")
                .params("cpn","1")
                .params("usr",name)
                .params("pwd", CommonUtil.getMd5(password))
                .execute(new StringCallback() {
                    @Override
                    public void onSuccess(Response<String> response) {
                        KLog.d(response.body().toString());
                    }
                });
    }
}
